package com.huawei.hwid.core.encrypt;

import android.text.TextUtils;
import com.huawei.hms.support.api.entity.hwid.HwIDConstant.SCOPE;
import com.huawei.hwid.core.constants.HwAccountConstants;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class e {
    private static final List<String> a = new ArrayList();
    private static String[] b = new String[]{"userid", "password", "siteid", "plmn", "mobilephone", "deviceinfo", "uuid", "deviceid2", "secretdigest", "salt", "emmcid", "secretdigesttype", "clientip", "deviceid", "device_id", "securityphone", "securityemail", "cookie", "devicetype", "useremail", SCOPE.SCOPE_ACCOUNT_EMAIL, HwAccountConstants.PARA_ACCOUNT_SERVICETOKEN, "oldpassword", "newpassword", "thirdtoken", "smsauthcode", "phone", "access_token", "sc", "sso_st", "token", "ac", "pw", "dvid", "pl", "dvid2", "sc", "emid", "sct", "c", "st", "app", Oauth2AccessToken.KEY_UID, "imsi", "thirdopenid", "thirdaccesstoken", "accountName", "useraccount", "fulluseraccount", "nickName", "uniquelynickname", "loginusername", "thirdnickname", "fingerST"};

    static {
        a();
    }

    private static void a() {
        if (b != null) {
            for (Object obj : b) {
                if (!TextUtils.isEmpty(obj)) {
                    a.add(obj.toLowerCase(Locale.ENGLISH));
                }
            }
        }
    }

    private static String a(char c, int i) {
        StringBuffer stringBuffer = new StringBuffer(i);
        for (int i2 = 0; i2 < i; i2++) {
            stringBuffer.append(c);
        }
        return stringBuffer.toString();
    }

    public static String a(String str) {
        if (TextUtils.isEmpty(str)) {
            return "";
        }
        if (str.length() == 1) {
            return "*";
        }
        int ceil = (int) Math.ceil(((double) (str.length() * 50)) / 100.0d);
        return a('*', ceil) + str.substring(ceil);
    }
}
